window.onload = function () {
    function loadingEffect() {
        var loading = $('#loader');
        loading.hide();
        $(document).ajaxStart(function () {
            loading.show();
        }).ajaxSuccess(function () {
            loading.hide();
        });
    }
    loadingEffect();
}